From f99727ee65ec571f94f3de8f011858fcb931c41b Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 30 Nov 2006 20:07:58 +0000 Subject: [PATCH] Fix managed domain rebooting by only complaining about a VM name conflict if the VM UUID conflicts as well. Also, remove the previous_restart_time node when explicitly rebooting a guest -- the user ought to be able to drive reboots faster than the safety catch. Signed-off-by: Ewan Mellor --- tools/python/xen/xend/XendDomainInfo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 91aef24838..d606dbb7bb 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -479,8 +479,9 @@ class XendDomainInfo: if reason not in DOMAIN_SHUTDOWN_REASONS.values(): raise XendError('Invalid reason: %s' % reason) + self._removeVm('xend/previous_restart_time') self.storeDom("control/shutdown", reason) - + def pause(self): """Pause domain @@ -1692,8 +1693,9 @@ class XendDomainInfo: raise VmError('Invalid VM Name') dom = XendDomain.instance().domain_lookup_nr(name) - if dom and dom != self and not dom.info['dying']: - raise VmError("VM name '%s' already exists" % name) + if dom and dom.info['uuid'] != self.info['uuid']: + raise VmError("VM name '%s' already exists as domain %s" % + (name, str(dom.domid))) def update(self, info = None, refresh = True): -- 2.30.2